# Cleanup Completed Monitor Directory Job
Removes old files from the monitor directory's Completed subfolder and from the service's log folder.
Configuration: SettingsCfg.Provisioning.CleanupCompletedMonitorDirectory / CleanupCompletedMonitorDirectoryFilters — see Global Settings Configuration.
Schedule: Runs once daily, at a random time between 00:00 and 06:00. The time is not configurable.
# Purpose
The monitor directory's Completed subfolder accumulates one file per successfully processed input file, and the Log folder accumulates log files, both indefinitely unless cleaned up. This job deletes files older than a configured number of days from both locations.
# Configuration
# CleanupCompletedMonitorDirectory
- Type:
int - Default:
14 - Description: Age, in days, after which files are removed. Files with a last-write time older than this many days are deleted. Set to
0to disable the job entirely.
# CleanupCompletedMonitorDirectoryFilters
- Type:
string (list) - Default:
["json"] - Description: File extensions to remove from the
Completedsubfolder. Leave empty to remove files of any extension. Only applies to the monitor directory cleanup — the log folder cleanup always targets*.logfiles regardless of this setting.
# How It Works
- Monitor directory cleanup — for each extension in
CleanupCompletedMonitorDirectoryFilters(or all files, if empty), deletes files in{MonitorDirectory}\Completed\whose last-write time is older thanCleanupCompletedMonitorDirectorydays. - Log directory cleanup — deletes
*.logfiles anywhere under the service'sLogfolder (recursively) whose last-write time is older than the sameCleanupCompletedMonitorDirectoryday count.
Only the Completed subfolder is cleaned — files in Error are left in place indefinitely so failures remain visible until manually addressed.
Warning: The default filter (
["json"]) removes completedClientMatter_*.jsonfiles. The ClientMatter JSON de-duplication check (see Client Matter execution flow → Duplicate-file avoidance) looks at theCompletedsubfolder to detect an unchanged resubmission. Once this job removes a file's completed copy, that comparison no longer has anything to match against, and a resubmission of the same unchanged matter update will be reprocessed instead of skipped.
# Related
- File handlers overview — how files move into the
Completedsubfolder - Global Settings Configuration — where this job is configured
- Jobs — other background jobs